<?php

/**
 * This is the model metadata class for table "goods_train_ticket".
 */
class GoodsTrainTicketMetadata extends CARMDC
{
	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 'goods_train_ticket';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('aircraft_type, departure_province, departure_city, arrival_province, arrival_city', 'required'),
			array('goods_id, uid, departure_province, departure_city, arrival_province, arrival_city, num', 'numerical', 'integerOnly'=>true),
			array('airlines, aircraft_type, flight, departure_airport, landing_airport', 'length', 'max'=>20),
			array('accommodation', 'length', 'max'=>255),
			array('departure_time, landing_time', 'safe'),
			// The following rule is used by search().
			// Please remove those attributes that should not be searched.
			array('id, goods_id, uid, airlines, aircraft_type, flight, accommodation, departure_province, departure_city, arrival_province, arrival_city, departure_airport, landing_airport, num, departure_time, landing_time', 'safe', 'on'=>'search'),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'id' => 'ID',
			'goods_id' => '商品id',
			'uid' => '用户',
			'airlines' => '航空公司',
			'aircraft_type' => '机型',
			'flight' => '航班',
			'accommodation' => '舱位',
			'departure_province' => '出发省',
			'departure_city' => '出发城市',
			'arrival_province' => '到达省',
			'arrival_city' => '到达城市',
			'departure_airport' => '起飞机场',
			'landing_airport' => '降落机场',
			'num' => '数量',
			'departure_time' => 'Departure Time',
			'landing_time' => 'Landing Time',
		);
	}
}